package com.example.myspring.entity;


import java.util.HashMap;
import java.util.Map;

//实体类，固定文件字段名
public class Student {

    private String id;         //id 字段
    private String name;         //姓名 字段
    private String sex;          //性别 字段
    private String age;          //年龄 字段
    private String address;      //地址 字段
    private String password;      //地址 字段

    public Student() {
    }

    public Student( String name, String sex, String age, String address) {
        this.name = name;
        this.sex = sex;
        this.age = age;
        this.address = address;
    }

    public Student(String id, String name, String sex, String age, String address,String password) {
        this.id = id;
        this.name = name;
        this.sex = sex;
        this.age = age;
        this.address = address;
        this.password = password;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String toString() {
        return "Student{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", age='" + age + '\'' +
                ", address='" + address + '\'' +
                ", password='" + password + '\'' +
                '}';
    }

    public Map<String, String> toMap() {
        Map<String, String> map = new HashMap<>();
        map.put("id", id);
        map.put("name", name);
        map.put("sex", sex);
        map.put("age", age);
        map.put("address", address);
        map.put("pwd", password);

        return map;

    }
}
